#include <vector>
using namespace std;

bool success(vector<int>extended_diff,vector<int> flip_marks,unsigned int start,unsigned int n){

    int check_flips = 0;
        for (unsigned int i = start; i < start + n; ++i) {
            check_flips ^= flip_marks[i];
            if ((extended_diff[i % (2*n)] ^ check_flips) != 0) {
                return false;
                break;
            }
        }
    return true;
}